﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using SageKing.Database.Contracts;

namespace SageKing.UI.Blazor.SageKingAntDesign.Contracts;

public abstract class ModalCRUDBase<Tmodel, Tcomponent, Trow, Tparent> : ModalBase<Tmodel>, IModalCRUD<Tmodel, Tcomponent, Trow, Tparent>
    where Tcomponent : IComponent
    where Tmodel : ICloneable
{
    public virtual IModalCRUD<Tmodel, Tcomponent, Trow, Tparent> MeCrud => this;

    public virtual Tcomponent Component { get; set; }

    public virtual Task DeleteData(Tmodel row, Tparent parent)
    {
        return Task.FromResult(true);
    }

    public virtual Task<bool> InitModel(Trow id)
    {
        return Task.FromResult(true);
    }
}
